package demo2;

public class Test2 {
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main1(String[] args) {

        drawMap(new Rect());
    }

   /* public static void main2(String[] args) {
        Shape shape = new Shape() ;
    }*/
}

abstract  class Shape{
    public abstract void draw();
}

abstract class Cycle extends Shape {

}

class A extends Cycle{

    @Override
    public void draw() {

    }
}

class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}